<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>物资信息报备</title>
    <link rel="stylesheet" href="css/table1.css">
    <link rel="stylesheet" href="css/mulu.css">
    <link rel="stylesheet" href="css/element.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/0_common/bootstrap-table.css">
    <script src="css/jquery.min.js"></script>
    <script src="css/vue.js"></script>
    <script src="css/element.js"></script>
    <script src="js/table.js"></script>
    <script src="js/0_common/bootstrap.min.js"></script>
    <script src="js/0_common/bootstrap-table.js"></script>
    <script src="js/constants.js"></script>
    <script src="js/YZidCard.js"></script>
    <style>
        #wz-ui span.hangtitle:before {
            content: "*";
            color: red;
        }
        #daorumb{
            height: 50%;
            margin-top: 0.8%;
            float: left;
            margin-left: 4%;
            cursor: pointer;
        }
    </style>
</head>
<body id="wz-ui">
<div class="dqy"><span>当前页：物资信息报备</span></div>
<div id="dhmenu">
    <div id="add"><div class="caozuobox"><img src="img/table/add.png"></div><div class="caozuobox"><span>新增</span></div></div>
    <div id="update"><div class="caozuobox"><img src="img/table/update.png"></div><div class="caozuobox"><span>修改</span></div></div>
    <div id="delete"><div class="caozuobox"><img src="img/table/delete.png"></div><div class="caozuobox"><span>删除</span></div></div>
   <!-- <div id="shangbao"><div class="caozuobox"><img src="img/table/shangbao.png"></div><div class="caozuobox"><span>上报</span></div></div>
    <div id="qbshangbao"><div class="caozuobox"><img src="img/table/qbshangbao.png"></div><div class="caozuobox"><span>全部上报</span></div></div>-->
    <input type="file" name="excelFile" id="excelFile" class="btn btn-default"  multiple="multiple" onchange="fileUpload()" style="display: none">
    <div id="import" onclick="selectFile()"><div class="caozuobox"><img src="img/table/import.png"></div><div class="caozuobox"><span>导入</span></div></div>
    <div id="export"><div class="caozuobox"><img src="img/table/export.png"></div><div class="caozuobox"><span>导出</span></div></div>
    <a  id="daorumb">下载导入模板</a>
<!--    <div id="daorumb"><div class="caozuobox"><img src="img/table/import.png"></div><div class="caozuobox"><span>导入模板</span></div></div>-->
    <button id="btn_search"></button>
    <input id="key" class="form-control" style="width:15%;height:23px;float:right;margin-top:0.8%;margin-right: 2%"/>


</div>
<div id="mainbox">
    <div id="titlebox"><span>物资信息报备</span></div>
    <div id="tabletopbox">
        <div class="tishibox"><img src="img/tishi.png"></div>
        <div class="tishibox"><span style="margin-left: 10px">查询结果(共</span><span id="number"></span><span>条信息)</span></div>
    </div>
    <div id="tablebox">
        <table id="table"
               data-toolbar="#toolbar"
               data-show-export="true"
               data-pagination="false"
               data-page-list="[10, 25, 50, 100, ALL]"
               data-id-field="id"
               data-side-pagination="server"
               data-url="../action"
               data-query-params="queryParams"
               data-query-params-type="limit">
        </table>
    </div>
</div>
<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="width: 70vw;">
    <div class="modal-dialog" style="width: 70vw">
        <div class="modal-content" style="border-radius: 15px;width: 100%;">
            <div class="modal-header" style="background-color:white;color: black;border-top-left-radius: 15px;border-top-right-radius: 15px">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title">物资信息报备</h4>
            </div>

            <div class="modal-body" style="width: 100%;float:left;background-color: #F3F3F3;height: auto" >
                <!-- <div style="width: 100%;height: 40px" id="but">
                     <button id="ShangBao1" class="btn btnleft">上报</button>
                     <button id="QuXiao" class="btn btnright">取消</button>
                 </div>-->
                <div class="hang">
                    <span class="hangtitle">报备日期</span><br>
                    <input id="createtime" class="hanginput" type="date"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">是否有应急药品</span><br>
                    <select id="yjyaopin" class="hanginput">
                        <option value="是">是</option>
                        <option value="否">否</option>
                    </select>
                </div>

                <div class="hang">
                    <span class="hangtitle">口罩数量(个)</span><br>
                    <input id="kzshuliang" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">口罩可用天数</span><br>
                    <input id="kztianshu" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">75%酒精数量（ml）</span><br>
                    <input id="jjshuliang" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">75%酒精可用天数</span><br>
                    <input id="jjtianshu" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>

                <div class="hang">
                    <span class="hangtitle">橡胶手套数量（双）</span><br>
                    <input id="stshuliang" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">橡胶手套可用天数</span><br>
                    <input id="sttianshu" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>

                <div class="hang">
                    <span class="hangtitle">测温仪器数量（个）</span><br>
                    <input id="cwyqshuliang" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">测温仪器可用天数</span><br>
                    <input id="cwyqtianshu" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>

                <div class="hang">
                    <span class="hangtitle">84消毒液数量（ml）</span><br>
                    <input id="efshuliang" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">84消毒液可用天数</span><br>
                    <input id="eftianshu" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>

                <div class="hang">
                    <span class="hangtitle">消毒洗手液数量（ml）</span><br>
                    <input id="xdxsyshuliang" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">消毒洗手液可用天数</span><br>
                    <input id="xdxsytianshu" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>


            </div>
            <div class="modal-footer" style="text-align: center">
                <button id="ShangBao1" class="btn">上报</button>
                <button data-dismiss="modal" id="QuXiao" class="btn">取消</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="width: 70vw;">
    <div class="modal-dialog" style="width: 70vw">
        <div class="modal-content" style="border-radius: 15px;width: 100%;">
            <div class="modal-header" style="background-color:white;color: black;border-top-left-radius: 15px;border-top-right-radius: 15px">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title">物资信息报备</h4>
            </div>

            <div class="modal-body" style="width: 100%;float:left;background-color: #F3F3F3;height: auto" id="xq">
                <!-- <div style="width: 100%;height: 40px" id="but">
                     <button id="ShangBao1" class="btn btnleft">上报</button>
                     <button id="QuXiao" class="btn btnright">取消</button>
                 </div>-->

                <div class="hang">
                    <span class="hangtitle">口罩数量(个)</span><br>
                    <input id="kzshuliang1" class="hanginput"  oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">口罩可用天数</span><br>
                    <input id="kztianshu1" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">75%酒精数量（ml）</span><br>
                    <input id="jjshuliang1" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">75%酒精可用天数</span><br>
                    <input id="jjtianshu1" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>

                <div class="hang">
                    <span class="hangtitle">橡胶手套数量（双）</span><br>
                    <input id="stshuliang1" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">橡胶手套可用天数</span><br>
                    <input id="sttianshu1" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>

                <div class="hang">
                    <span class="hangtitle">测温仪器数量（个）</span><br>
                    <input id="cwyqshuliang1" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">测温仪器可用天数</span><br>
                    <input id="cwyqtianshu1" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>

                <div class="hang">
                    <span class="hangtitle">84消毒液数量（ml）</span><br>
                    <input id="efshuliang1" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">84消毒液可用天数</span><br>
                    <input id="eftianshu1" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>

                <div class="hang">
                    <span class="hangtitle">消毒洗手液数量（ml）</span><br>
                    <input id="xdxsyshuliang1" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>
                <div class="hang">
                    <span class="hangtitle">消毒洗手液可用天数</span><br>
                    <input id="xdxsytianshu1" class="hanginput" oninput="value=value.replace(/[^\d]/g,'')"/>
                </div>

                <div class="hang">
                    <span class="hangtitle">是否有应急药品</span><br>
                    <select id="yjyaopin1" class="hanginput">
                        <option value="是">是</option>
                        <option value="否">否</option>
                    </select>
                </div>
            </div>
            <div class="modal-footer" style="text-align: center">
                <button id="ShangBao2" class="btn">上报</button>
                <button data-dismiss="modal" id="QuXiao1" class="btn">取消</button>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    var svcHeader = Constants.path
    var qyid = localStorage.getItem('qyid');

    var ctx = Constants.path;
    var file = ctx+"FUGONGP/";

    $("#daorumb").unbind('click').click(function () {
        window.location.href=file + '物资信息.xlsx'
    })

    $(function () {
        //1.初始化Table
        var oTable = new TableInit();
        oTable.Init();
        //
        // //2.初始化Button的点击事件
        // var oButtonInit = new ButtonInit();
        // oButtonInit.Init();
    });
    var TableInit = function () {
        var oTableInit = new Object();
        //初始化Table
        oTableInit.Init = function () {
            $('#table').bootstrapTable({
                url: svcHeader+'pb/wzxxs/action/findByKey',         //请求后台的URL（*）
                method: 'get',                      //请求方式（*）
                toolbar: '#toolbar',                //工具按钮用哪个容器
                striped: true,                      //是否显示行间隔色
                cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                pagination: true,                   //是否显示分页（*）
                sortable: false,                     //是否启用排序
                sortOrder: "asc",                   //排序方式
                queryParams: oTableInit.queryParams,//传递参数（*）
                sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                pageNumber: 1,                       //初始化加载第一页，默认第一页
                pageSize: 10,                       //每页的记录行数（*）
                pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                // search: true,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                // strictSearch: true,
                // showColumns: true,                  //是否显示所有的列
                // showRefresh: true,                  //是否显示刷新按钮
                minimumCountColumns: 2,             //最少允许的列数
                clickToSelect: true,                //是否启用点击选中行
                //height: 500,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
                uniqueId: "ID",                     //每一行的唯一标识，一般为主键列
                // showToggle: true,                    //是否显示详细视图和列表视图的切换按钮
                cardView: false,                    //是否显示详细视图
                detailView: false,                   //是否显示父子表
                responseHandler:responseHandler,
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'createtime',
                        align: 'center',
                        title: ' 报备日期 ',
                        formatter: function (value, row, index) {
                            return changeDateFormat(value)
                        },
                        width:'500'
                    },
                    {
                        field: 'kzshuliang',
                        align: 'center',
                        title: '口罩数量(个)'
                    }, {
                        field: 'kztianshu',
                        align: 'center',
                        title: '口罩可用天数'
                    },{
                        field: 'jjshuliang',
                        align: 'center',
                        title: '75%酒精数量（ml）'
                    },{
                        field: 'jjtianshu',
                        align: 'center',
                        title: '75%酒精可用天数'
                    },{
                        field: 'stshuliang',
                        align: 'center',
                        title: '橡胶手套数量（双）'
                    },{
                        field: 'sttianshu',
                        align: 'center',
                        title: '橡胶手套可用天数'
                    },{
                        field: 'cwyqshuliang',
                        align: 'center',
                        title: '测温仪器数量（个）'
                    },{
                        field: 'cwyqtianshu',
                        align: 'center',
                        title: '测温仪器可用天数'
                    },{
                        field: 'efshuliang',
                        align: 'center',
                        title: '84消毒液数量（ml）'
                    },{
                        field: 'eftianshu',
                        align: 'center',
                        title: '84消毒液可用天数'
                    },{
                        field: 'xdxsyshuliang',
                        align: 'center',
                        title: '消毒洗手液数量（ml）'
                    },{
                        field: 'xdxsytianshu',
                        align: 'center',
                        title: '消毒洗手液可用天数'
                    },
                    {
                        field: 'yjyaopin',
                        align: 'center',
                        title: '应急药品'
                    },
                    /*{
                        field: 'status',
                        align: 'center',
                        title: '状态',
                        formatter : function(value, row, index) {
                            var a = "";
                            if(row.status=='0') {
                                var a = '未上报';
                            }else if(row.status=='1'){
                                var a = '已上报';
                            }
                            return a;
                        },
                    },*/

                ],
            });
            initTableHeight()
        }
        oTableInit.queryParams = function (params) {
            var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                pageNo:params.offset/params.limit+1,
                pageSize:params.limit,
                qyid:qyid,
                key:$("#key").val(),
            };
            return temp;
        };
        return oTableInit;
    };
    function   responseHandler(res) {
        $("#number").text(res.data.count)
        return {
            "rows": res.data.entities,
            "total":res.data.count
            //数据
        }
    }

    function changeDateFormat(cellval) {
        var dateVal = cellval + "";
        if (cellval != null) {
            var date = /\d{4}-\d{1,2}-\d{1,2}/g.exec(cellval);
            return  date ;
        }
    }

    //新增
    $('body').on('hidden.bs.modal', '.modal', function () {
        $("#createtime").val('');

        $("#kzshuliang").val('');
        $("#kztianshu").val('');

        $("#jjshuliang").val('');
        $("#jjtianshu").val('');

        $("#stshuliang").val('');
        $("#sttianshu").val('');

        $("#cwyqshuliang").val('');
        $("#cwyqtianshu").val('');

        $("#efshuliang").val('');
        $("#eftianshu").val('');

        $("#xdxsyshuliang").val('');
        $("#xdxsytianshu").val('');

        $("#yjyaopin").val('是');

    })
    $("#add").unbind('click').click(function () {
        $("#myModal1").modal('show');
    })
    $("#ShangBao1").unbind('click').click(function () {
        var obj = {
            'createtime': $("#createtime").val(),
            'kzshuliang': $("#kzshuliang").val(),
            'kztianshu': $("#kztianshu").val(),
            'jjshuliang': $("#jjshuliang").val(),
            'jjtianshu': $("#jjtianshu").val(),
            'stshuliang': $("#stshuliang").val(),
            'sttianshu': $("#sttianshu").val(),
            'cwyqshuliang': $("#cwyqshuliang").val(),
            'cwyqtianshu': $("#cwyqtianshu").val(),
            'efshuliang': $("#efshuliang").val(),
            'eftianshu': $("#eftianshu").val(),
            'xdxsyshuliang': $("#xdxsyshuliang").val(),
            'xdxsytianshu': $("#xdxsytianshu").val(),
            'yjyaopin': $("#yjyaopin").val(),
            'qyid': qyid,
        };
        let success = true;
        for (let key in obj) {
            if (key === 'createtime') {
                continue;
            }
            if (!obj[key] || obj[key] == '') {
                success = false;
                alert("请填写必填项！");
                return;
            }
            if (key.indexOf('tianshu') != -1 && obj[key] < 5) {
                success = false;
                alert("天数必须大于等于5天")
                return;
            }
        }
        if (!success) {
            return;
        }
        $.ajax({
            url:svcHeader+"pv/wzxxs",
            dataType:'json',
            type:'POST',
            contentType: 'application/json',
            data:JSON.stringify(obj),
            success:function (data) {
                if(data.code=="200"){
                    alert("新增成功！")
                    $("#myModal1").modal('hide');
                    $("#table").bootstrapTable('destroy');
                    var oTable = new TableInit();
                    oTable.Init();
                }else{
                    alert(data.msg)
                }
            }
        })
    })
    //删除
    $("#delete").unbind('click').click(function(){
        var row = $.map($('#table').bootstrapTable(
            'getSelections'), function(row) {
            return row;
        })
        var x=row.length;
        var msg="删除";
        var y=0;
        var z=0;
        if(row.length==0){
            alert("请选择要删除的数据！")
        }else{
            for(var i=0;i<row.length;i++) {
                $.ajax({
                    url: svcHeader + "/delete/wzxxs/"+row[i].id,
                    // dataType: 'json',
                    type: 'delete',
                    async: false,
                    success: function (data) {
                        if(data.code=='200'){
                            if(data.result==true){
                                y=y+1;
                            }else{
                                z=z+1;
                            }
                            if(y==x){
                                alert('已成功删除' + y + "条！")
                            }
                            $("#table").bootstrapTable('destroy');
                            var oTable = new TableInit();
                            oTable.Init();
                        }else{
                            alert(data.msg)
                        }
                    }
                })
            }
            if(y!=x){
                alert('已成功删除' + z + "条！失败"+y+'条！')
            }
        }
    })
    //修改
    $("#update").unbind('click').click(function(){
        var row = $.map($('#table').bootstrapTable(
            'getSelections'), function(row) {
            return row;
        });
        if(row.length==1){
            if(row[0].status=='0'){
                $("#myModal2").modal('show');


                $("#kzshuliang1").val(row[0].kzshuliang);
                $("#kztianshu1").val(row[0].kztianshu);

                $("#jjshuliang1").val(row[0].jjshuliang);
                $("#jjtianshu1").val(row[0].jjtianshu);

                $("#stshuliang1").val(row[0].stshuliang);
                $("#sttianshu1").val(row[0].sttianshu);

                $("#cwyqshuliang1").val(row[0].cwyqshuliang);
                $("#cwyqtianshu1").val(row[0].cwyqtianshu);

                $("#efshuliang1").val(row[0].efshuliang);
                $("#eftianshu1").val(row[0].eftianshu);

                $("#xdxsyshuliang1").val(row[0].xdxsyshuliang);
                $("#xdxsytianshu1").val(row[0].xdxsytianshu);

                $("#yjyaopin1").val(row[0].yjyaopin);

                $("#ShangBao2").unbind('click').click(function () {
                    var obj = {
                        'id':row[0].id,
                        'createtime': $("#createtime1").val(),

                        'kzshuliang': $("#kzshuliang1").val(),
                        'kztianshu': $("#kztianshu1").val(),

                        'jjshuliang': $("#jjshuliang1").val(),
                        'jjtianshu': $("#jjtianshu1").val(),

                        'stshuliang': $("#stshuliang1").val(),
                        'sttianshu': $("#sttianshu1").val(),

                        'cwyqshuliang': $("#cwyqshuliang1").val(),
                        'cwyqtianshu': $("#cwyqtianshu1").val(),

                        'efshuliang': $("#efshuliang1").val(),
                        'eftianshu': $("#eftianshu1").val(),

                        'xdxsyshuliang': $("#xdxsyshuliang1").val(),
                        'xdxsytianshu': $("#xdxsytianshu1").val(),

                        'yjyaopin': $("#yjyaopin1").val(),
                        'qyid': qyid,
                        'status': '0',
                    };
                    console.log(obj)
                    let success = true;
                    for (let key in obj) {
                        if (key === 'createtime') {
                            continue;
                        }
                        if (!obj[key] || obj[key] == '') {
                            success = false;
                            alert("请填写必填项！");
                            return;
                        }
                        if (key.indexOf('tianshu') != -1 && obj[key] < 5) {
                            success = false;
                            alert("天数必须大于等于5天")
                            return;
                        }
                    }
                    if (!success) {
                        return;
                    }

                    $.ajax({
                        url: svcHeader + "/pv/wzxxs/"+row[0].id,
                        dataType: 'json',
                        type: 'put',
                        contentType: 'application/json',
                        data: JSON.stringify(obj),
                        success: function (data) {
                            if(data.code=="200") {
                                alert('修改成功！')
                                $("#myModal2").modal('hide');
                                $("#table").bootstrapTable('destroy');
                                var oTable = new TableInit();
                                oTable.Init();
                            }else{
                                alert(data.msg)
                            }
                        }
                    })
                })
            }else {
                alert("该条数据已上报，不能修改！")
            }
        }else{
            alert("只能选择一条")
        }
    })
    //全部上报
    $("#qbshangbao").unbind('click').click(function(){
        var obj = {
            'qyid': qyid,
        }
        $.ajax({
            url: svcHeader + "pv/wzplxxs",
            dataType: 'json',
            type: 'put',
            contentType: 'application/json',
            data: JSON.stringify(obj),
            success: function (data) {
                if(data.code=="200") {
                    alert('上报成功！')
                    $("#table").bootstrapTable('destroy');
                    var oTable = new TableInit();
                    oTable.Init();
                }else{
                    alert(data.msg)
                }
            }
        })

    })
    $("#shangbao").unbind('click').click(function(){
        var row = $.map($('#table').bootstrapTable(
            'getSelections'), function(row) {
            return row;
        });
        if(row.length==1){
            var obj = {
                'id':row[0].id,
                'status':'1',
            };

            $.ajax({
                url: svcHeader + "pv/wzxxs/"+row[0].id,
                dataType: 'json',
                type: 'put',
                contentType: 'application/json',
                data: JSON.stringify(obj),
                success: function (data) {
                    if(data.code=="200") {
                        alert('修改成功！')
                        $("#myModal2").modal('hide');
                        $("#table").bootstrapTable('destroy');
                        var oTable = new TableInit();
                        oTable.Init();
                    }else{
                        alert(data.msg)
                    }
                }
            })
        }else{
            alert("只能选择一条")
        }
    })

    $("#btn_search").unbind('click').click(function () {
        $("#table").bootstrapTable('destroy');
        var oTable = new TableInit();
        oTable.Init();
    })

    $("#export").click(function () {
        window.location.href=svcHeader+"wzxxs/export?qyid="+qyid
    })
    function selectFile(){
        $("#excelFile").trigger("click");
    }
    function fileUpload() {
        var file=document.getElementById("excelFile");
        var fileObj = file.files[0];
        var formdata = new FormData();
        formdata.append('file',fileObj);
        formdata.append('qyid',qyid);
        //console.log(formdata)
        $.ajax({
            url: svcHeader + "wzxxs/import",//这里写你的url
            type: 'POST',
            data:formdata,
            processData:false,
            contentType:false,
            success: function (map) {
                alert("上传成功!");
                $("#table").bootstrapTable('refresh');
            },
            error: function (data) {
                alert("页面请求失败！");
            }
        })
    }
</script>

</html>
